package com.home.job.zh2.job3;

import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class InputListener implements ActionListener {
	
	private Sudoku sudoku;
	public InputListener(Sudoku s){
		if (s == null){
			throw new IllegalArgumentException("Sudoku obj should not be null.");
		}
		this.sudoku = s;
	}
	   
   @Override
    public void actionPerformed(ActionEvent e) {
	   sudoku.findSelectedCell((JTextField)e.getSource());
	   sudoku.isSelectedCellInputCorrect();
	   sudoku.isGameOver();
    }

}
